Optimal. Leaf size=171 \[ \frac{\left (16 a^2 A b+3 a^3 B+12 a b^2 B+4 A b^3\right ) \sin (c+d x)}{6 d}+\frac{b \left (6 a^2 B+20 a A b+9 b^2 B\right ) \sin (c+d x) \cos (c+d x)}{24 d}+\frac{1}{8} x \left (8 a^3 A+12 a^2 b B+12 a A b^2+3 b^3 B\right )+\frac{(3 a B+4 A b) \sin (c+d x) (a+b \cos (c+d x))^2}{12 d}+\frac{B \sin (c+d x) (a+b \cos (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.196937, antiderivative size = 171, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.087, Rules used = {2753, 2734} \[ \frac{\left (16 a^2 A b+3 a^3 B+12 a b^2 B+4 A b^3\right ) \sin (c+d x)}{6 d}+\frac{b \left (6 a^2 B+20 a A b+9 b^2 B\right ) \sin (c+d x) \cos (c+d x)}{24 d}+\frac{1}{8} x \left (8 a^3 A+12 a^2 b B+12 a A b^2+3 b^3 B\right )+\frac{(3 a B+4 A b) \sin (c+d x) (a+b \cos (c+d x))^2}{12 d}+\frac{B \sin (c+d x) (a+b \cos (c+d x))^3}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2753
Rule 2734
Rubi steps
\begin{align*} \int (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx &=\frac{B (a+b \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac{1}{4} \int (a+b \cos (c+d x))^2 (4 a A+3 b B+(4 A b+3 a B) \cos (c+d x)) \, dx\\ &=\frac{(4 A b+3 a B) (a+b \cos (c+d x))^2 \sin (c+d x)}{12 d}+\frac{B (a+b \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac{1}{12} \int (a+b \cos (c+d x)) \left (12 a^2 A+8 A b^2+15 a b B+\left (20 a A b+6 a^2 B+9 b^2 B\right ) \cos (c+d x)\right ) \, dx\\ &=\frac{1}{8} \left (8 a^3 A+12 a A b^2+12 a^2 b B+3 b^3 B\right ) x+\frac{\left (16 a^2 A b+4 A b^3+3 a^3 B+12 a b^2 B\right ) \sin (c+d x)}{6 d}+\frac{b \left (20 a A b+6 a^2 B+9 b^2 B\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac{(4 A b+3 a B) (a+b \cos (c+d x))^2 \sin (c+d x)}{12 d}+\frac{B (a+b \cos (c+d x))^3 \sin (c+d x)}{4 d}\\ \end{align*}
Mathematica [A] time = 0.381848, size = 140, normalized size = 0.82 \[ \frac{12 (c+d x) \left (8 a^3 A+12 a^2 b B+12 a A b^2+3 b^3 B\right )+24 b \left (3 a^2 B+3 a A b+b^2 B\right ) \sin (2 (c+d x))+24 \left (12 a^2 A b+4 a^3 B+9 a b^2 B+3 A b^3\right ) \sin (c+d x)+8 b^2 (3 a B+A b) \sin (3 (c+d x))+3 b^3 B \sin (4 (c+d x))}{96 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.045, size = 180, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ( B{b}^{3} \left ({\frac{\sin \left ( dx+c \right ) }{4} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\cos \left ( dx+c \right ) }{2}} \right ) }+{\frac{3\,dx}{8}}+{\frac{3\,c}{8}} \right ) +{\frac{A{b}^{3} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+Ba{b}^{2} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) +3\,Aa{b}^{2} \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +3\,{a}^{2}bB \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +3\,A{a}^{2}b\sin \left ( dx+c \right ) +{a}^{3}B\sin \left ( dx+c \right ) +A{a}^{3} \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.16311, size = 231, normalized size = 1.35 \begin{align*} \frac{96 \,{\left (d x + c\right )} A a^{3} + 72 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} b + 72 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a b^{2} - 96 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a b^{2} - 32 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b^{3} + 3 \,{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B b^{3} + 96 \, B a^{3} \sin \left (d x + c\right ) + 288 \, A a^{2} b \sin \left (d x + c\right )}{96 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.34661, size = 321, normalized size = 1.88 \begin{align*} \frac{3 \,{\left (8 \, A a^{3} + 12 \, B a^{2} b + 12 \, A a b^{2} + 3 \, B b^{3}\right )} d x +{\left (6 \, B b^{3} \cos \left (d x + c\right )^{3} + 24 \, B a^{3} + 72 \, A a^{2} b + 48 \, B a b^{2} + 16 \, A b^{3} + 8 \,{\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right )^{2} + 9 \,{\left (4 \, B a^{2} b + 4 \, A a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.76105, size = 386, normalized size = 2.26 \begin{align*} \begin{cases} A a^{3} x + \frac{3 A a^{2} b \sin{\left (c + d x \right )}}{d} + \frac{3 A a b^{2} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{3 A a b^{2} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{3 A a b^{2} \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} + \frac{2 A b^{3} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{A b^{3} \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac{B a^{3} \sin{\left (c + d x \right )}}{d} + \frac{3 B a^{2} b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{3 B a^{2} b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{3 B a^{2} b \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} + \frac{2 B a b^{2} \sin ^{3}{\left (c + d x \right )}}{d} + \frac{3 B a b^{2} \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac{3 B b^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac{3 B b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac{3 B b^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac{3 B b^{3} \sin ^{3}{\left (c + d x \right )} \cos{\left (c + d x \right )}}{8 d} + \frac{5 B b^{3} \sin{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text{for}\: d \neq 0 \\x \left (A + B \cos{\left (c \right )}\right ) \left (a + b \cos{\left (c \right )}\right )^{3} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.36552, size = 200, normalized size = 1.17 \begin{align*} \frac{B b^{3} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac{1}{8} \,{\left (8 \, A a^{3} + 12 \, B a^{2} b + 12 \, A a b^{2} + 3 \, B b^{3}\right )} x + \frac{{\left (3 \, B a b^{2} + A b^{3}\right )} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac{{\left (3 \, B a^{2} b + 3 \, A a b^{2} + B b^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac{{\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]